package com.ruoyi.common.log.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 农作物

 * @TableName sys_crop
 */
@TableName(value ="sys_crop")
@Data
public class SysCrop implements Serializable {
    /**
     * 农作物主键Id
     */
    @TableId(type = IdType.AUTO)
    private Integer cropId;

    /**
     * 唯一编码
     */
    private String cropEncoding;

    /**
     * 农作物名称
     */
    private String name;

    /**
     * 种植基地外键
     */
    private Integer plantationId;

    /**
     * 农户id
     */
    private Integer userId;

    /**
     * 农作物图片
     */
    private String img;

    /**
     * 省
     */
    private Integer provinceId;

    /**
     * 市
     */
    private Integer cityId;

    /**
     * 区
     */
    private Integer areaId;

    /**
     * 种植方式外键
     */
    private Integer plantingMethodId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 状态 0 种植中 1 记录完成  2成熟  3入库  4 运输  
     */
    private Integer status;

    /**
     * 占地(亩)
     */
    private String coverArea;

    /**
     * 产量(斤)
     */
    private Double output;

    /**
     * 是否质检
     */
    private Integer isquality;
    @TableField(exist = false)
    private String provinceName;
    @TableField(exist = false)
    private String cityName;
    @TableField(exist = false)
    private String districtName;
    @TableField(exist = false)
    private String pname;
    @TableField(exist = false)
    private String mname;
    @TableField(exist = false)
    private String uname;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysCrop other = (SysCrop) that;
        return (this.getCropId() == null ? other.getCropId() == null : this.getCropId().equals(other.getCropId()))
            && (this.getCropEncoding() == null ? other.getCropEncoding() == null : this.getCropEncoding().equals(other.getCropEncoding()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getPlantationId() == null ? other.getPlantationId() == null : this.getPlantationId().equals(other.getPlantationId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
            && (this.getProvinceId() == null ? other.getProvinceId() == null : this.getProvinceId().equals(other.getProvinceId()))
            && (this.getCityId() == null ? other.getCityId() == null : this.getCityId().equals(other.getCityId()))
            && (this.getAreaId() == null ? other.getAreaId() == null : this.getAreaId().equals(other.getAreaId()))
            && (this.getPlantingMethodId() == null ? other.getPlantingMethodId() == null : this.getPlantingMethodId().equals(other.getPlantingMethodId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCoverArea() == null ? other.getCoverArea() == null : this.getCoverArea().equals(other.getCoverArea()))
            && (this.getOutput() == null ? other.getOutput() == null : this.getOutput().equals(other.getOutput()))
            && (this.getIsquality() == null ? other.getIsquality() == null : this.getIsquality().equals(other.getIsquality()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCropId() == null) ? 0 : getCropId().hashCode());
        result = prime * result + ((getCropEncoding() == null) ? 0 : getCropEncoding().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getPlantationId() == null) ? 0 : getPlantationId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        result = prime * result + ((getProvinceId() == null) ? 0 : getProvinceId().hashCode());
        result = prime * result + ((getCityId() == null) ? 0 : getCityId().hashCode());
        result = prime * result + ((getAreaId() == null) ? 0 : getAreaId().hashCode());
        result = prime * result + ((getPlantingMethodId() == null) ? 0 : getPlantingMethodId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCoverArea() == null) ? 0 : getCoverArea().hashCode());
        result = prime * result + ((getOutput() == null) ? 0 : getOutput().hashCode());
        result = prime * result + ((getIsquality() == null) ? 0 : getIsquality().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", cropId=").append(cropId);
        sb.append(", cropEncoding=").append(cropEncoding);
        sb.append(", name=").append(name);
        sb.append(", plantationId=").append(plantationId);
        sb.append(", userId=").append(userId);
        sb.append(", img=").append(img);
        sb.append(", provinceId=").append(provinceId);
        sb.append(", cityId=").append(cityId);
        sb.append(", areaId=").append(areaId);
        sb.append(", plantingMethodId=").append(plantingMethodId);
        sb.append(", createTime=").append(createTime);
        sb.append(", createBy=").append(createBy);
        sb.append(", status=").append(status);
        sb.append(", coverArea=").append(coverArea);
        sb.append(", output=").append(output);
        sb.append(", isquality=").append(isquality);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}